<?php
namespace app\controllers\v1;

use yii\web\Controller;
use yii\web\Response;

class AbdominalBreathingController extends Controller
{
    public function behaviors()
    {
        $behaviors = parent::behaviors();
        $behaviors['contentNegotiator']['formats']['text/html'] = Response::FORMAT_JSON;
        return $behaviors;
    }

    // http://loc.testyii.com/v1/abdominal-breathing/index
    public function actionIndex()
    {
        $data = [
            'message' => '这是一个简单的 API 接口',
            'status' => 200
        ];
        return $data;
    }
}